package com.gugee.tiktok.web.repository.impl;

import com.gugee.tiktok.web.dto.HistoryResponse;
import com.gugee.tiktok.web.repository.ComparisonHistoryExtRepository;
import com.xiguaji.boot.toolkit.jdbc.JdbcTemplateHelper;
import com.xiguaji.boot.toolkit.jdbc.Page;

public class ComparisonHistoryExtRepositoryImpl implements ComparisonHistoryExtRepository {

    @Override
    public Page<HistoryResponse> getPage(int page, int pageSize, long userId){
        StringBuilder sql = new StringBuilder(" from comparison_history where user_id = ? order by create_time desc ");

        return JdbcTemplateHelper.paginate(HistoryResponse.class,page,pageSize,"select id,create_time createTime",sql.toString(),userId);
    }
}
